<template>
    <div class="input-box">
    <input type="text" placeholder="请输入任务名称" v-model="inputText" />
    <button @click="check">新增任务</button>
  </div>
</template>
<script setup>
import {useRouter} from "vue-router"
import { ref} from "vue";
// 从对应文件导入
import { useTasklistStore } from "../stores/tasklist";
import { useUserStore } from "../stores/user";
import { useTokenStore } from "../stores/token";


let $router = useRouter()
let check = () =>{
    $router.push('/index')
    store.addTask(inputText.value)
    inputText.value=""
}
var inputText = ref('')
var store = useTasklistStore()
//调用 useUserStore 方法 获取store对象
var userStore = useUserStore();

//调用 useTokenStore 方法 获取store对象
var tokenStore = useTokenStore();

</script>
<style scoped>
.input-box input{

    width: 100%;
    height: 60px;
}
button{
    width: 100%;
    height: 60px;
    margin-top: 30px;
    font-size: 20px;
    background-color: aqua;
    border: none;
    border-radius: 10px;
}
</style>